<template>
  <div id="learningmode">
    <div class="main">
      <Row>
        <!-- 小标题 -->
        <Col span="24" class="minTitle">{{learning.minTitle}}</Col>
      </Row>
      <Row>
        <Col span="24">
        <!-- swiper容器 -->
          <div class="swiper-container">
            <div class="swiper-wrapper">
              <div class="swiper-slide" v-for="(course,index) in learning.courses" :key="index">
                <div class="SVIP" :style="'color:'+course.fontcolor">
                  <!-- 大标题 -->
                  <p class="subMaxTitle">{{course.maxTitle}}</p>
                  <!-- 价钱 -->
                  <p class="subMinTitle">￥{{course.minPrice.$numberDecimal}}</p>
                  <!-- 详细信息 -->
                  <p v-for="(info,infoindex) in course.infos" :key="infoindex">{{info}}</p>
                </div>
              </div>
            </div>
          </div>
        </Col>
      </Row>
    </div>
  </div>
</template>

<script>
//iview-ui 组件导入
import { Row, Col } from "view-design";
//导入swiper组件
import Swiper from "swiper";
export default {
  name: "learningmode",
  //组件注册
  components: {
    Row,
    Col
  },
  //属性数据传入
  props: ["learning"],
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {
    //挂载swiper轮播图
    var swiper = new Swiper(".swiper-container", {
      slidesPerView: 1.8,
      spaceBetween: 15,
      freeMode: true,
      slidesOffsetBefore: 20,
      slidesOffsetAfter: 20
      // pagination: {
      //   el: '.swiper-pagination',
      //   clickable: true,
      // },
    });
  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>

<style scoped>
/* 局部UI修改样式 */
.main {
}
.minTitle {
  font-size: 13px;
  color: #fff;
  text-align: center;
  background: url("./image/study-mode.svg") 20px no-repeat;
  padding: 20px 90px 32px;
}
.SVIP {
  padding: 12px 28px;
  font-size: 10px;
  line-height: 24px;
}
.subMaxTitle {
  font-size: 18px;
}
.subMinTitle {
  font-size: 15px;
}
</style>